﻿@model TumbaloSoft.Models.PersonaJuridica   
@{  
    Layout = "~/Views/Shared/_VentasLayout.cshtml";
    ViewBag.Title = "Modificar Cliente Juridica";
}

  <script>
                      $(document).ready(function () {
                          var id = $("#id");

                          function updateTips(t) {
                              tips
                                  .text(t)
                                  .addClass("ui-state-highlight");
                              setTimeout(function () {
                                  tips.removeClass("ui-state-highlight", 1500);
                              }, 500);
                          }

                          $("#dialog-form").dialog({
                              autoOpen: false,
                              height: 600,
                              width: 600,
                              modal: true,
                              buttons: {
                                  "Buscar": function () {
                                      document.getElementById('busqueda').submit()
                                      $(this).dialog("close");
                                  },
                                  Cancelar: function () {
                                      $(this).dialog("close");
                                  }
                              },
                              close: function () {
                                  allFields.val("").removeClass("ui-state-error");
                              }
                          });

                          $("#buscar")
                              .button()
                              .click(function () {
                                  $("#dialog-form").dialog("open");
                              });
                      });
                    </script>



<script>
    // increase the default animation speed to exaggerate the effect
    //$.fx.speeds._default = 4000;
    $(function () {
        $("#dialog").dialog({
            autoOpen: false,
            resizable: false,
            height: 240,
            modal: true,
            buttons: {
                "Si": function () {
                    $("#form_1").submit();

                    $(this).dialog('close');
                },

                "No": function () {
                    $(this).dialog("close");
                }
            }
        });

        $("#open").click(function () {
            $("#dialog").dialog("open");
            return false;
        });


    });
</script>


          
    <!-- content -->
    <div class="body2">
        <div class="main">
            <section id="content">
                <div class="wrapper">
                   <article class="col0" >
                       <nav class="urbangreymenu">
                                <h3 class="headerbar">Mantenimiento Cliente</h3>
                                    <ul id="subMenu">
                                     <li>
									   <h5>@Html.ActionLink("Ver Lista Clientes Jurídicos", "IndexPersonaJuridica")</h5>
								    </li>
                                    </ul>
                            </nav>
                       </article>

                     <!--Formulario de busqueda-->
                          <div id="dialog-form" title="Busqueda de Cliente">
                         <p class="validateTips">Ingrese los campos para la busqueda</p>

                      <form id="BusquedaVendedor" method="get"> <!--falta action="\vendedor"-->


                          <div class="row">
                                    <span>Codigo</span>
                                    @Html.TextBoxFor(model => model.prIdPersona, new { style = "border: 1px solid black; margin-left: 41px; margin-bottom: 6px;" }) 
                                    @Html.ValidationMessageFor(model => model.prIdPersona) 

                                    </div>

                                <div class="row">
                                    <span>Razón Social</span>
                                    @Html.TextBoxFor(model => model.prRazonSocial, new { style = "border: 1px solid black; border: 1px solid black; margin-left: 36px; margin-bottom: 6px;" }) 
                                    @Html.ValidationMessageFor(model => model.prRazonSocial) 
                                
                                </div>
                            
                                <div class="row">
                                    <span>Dirección</span>
                                    @Html.TextBoxFor(model => model.prDireccion, new { style = "border: 1px solid black; border: 1px solid black; margin-left: 36px; margin-bottom: 6px;" }) 
                                    @Html.ValidationMessageFor(model => model.prDireccion) 
                                
                                </div>

                                   <div class="row">
                                    <span>RUC</span>
                                    @Html.TextBoxFor(model => model.prRuc, new { style = "border: 1px solid black; border: 1px solid black; margin-left: 36px; margin-bottom: 6px;" }) 
                                    @Html.ValidationMessageFor(model => model.prRuc) 
                                
                                </div>
                                    

                          </form>
                      



                              <!--GRILLA-->
						<form id="ContactForm" method="post">
							<div class="wrapper">
								<br>
								<table border="1">
									<tr>
										<th>ID</th>
										<th>Direccion</th>
										<th>Razon Social</th>
										<th>RUC<th>
									
										<th>Editar</th>
									</tr>
									@foreach (var personaJuridica in ViewBag.ListaPersonaJuridica)
	    {
										<tr>
											<td>@personaJuridica.prIdPersona</td>
											<td>@personaJuridica.prDireccion</td>
											<td>@personaJuridica.prRuc</td>
											<td>@personaJuridica.prRazonSocial</td>
										
											<td><a href="/Ventas/MC_ModificarJuridica?prIdPersona=@personaJuridica.prIdPersona">Editar</a></td>
										</tr>
	    }
								</table>
								
							</div>
						</form>
                          </div>
                          

                    <!--TODO-->
                      <article class="col1">
                       <!--FORMULARIO-->
                          <form id="form_1" method="post" style="height:100% ; width: 563px">
                            <div class="pad1" style="padding-bottom: 29px; width:412px">
                                <h2 class="pad_bot1 pad_top1">Modificar Cliente Jurídico</h2>
                                <h3 class="pad_bot1 pad_top1">Datos del Cliente: </h3>
                                

                                 <div class="row">
                                                <table style="width: 420px">
                                                    <tr>
                                                        <td style="width: 210px"><a id="buscar">Buscar</a></td>
                                                         <td style="width: 210px">
                                                        
												        @Html.TextBoxFor(model => model.prIdPersona, new { disabled="true" ,@class = "input",style = "background-color: #b7b3b3" })
												        @Html.ValidationMessageFor(model => model.prIdPersona, null, new { style = "float: none" })
                                                  
                                                    </tr>
                                                </table>
                                            </div>

                                       
                        
                             
                                 <!--NOMBRE-->
                                <div class="row">
                                     <table style="width: 420px">
                                                    <tr>
                                
                                              <td style="width: 210px"><span>Razón Social:</span></td>
                                               <td style="width: 210px">     
                                      @Html.TextBoxFor(model => model.prRazonSocial, new { @Class ="input", maxlength = "30", minlength = "1"}) 
                                       @Html.ValidationMessageFor(model => model.prRazonSocial) 
                                                   </td>
                                                        </tr>
                                         </table>
                                </div>
                             
                                  <!--RUC-->
                                            <div class="row">
                                                <table style="width: 420px">
                                                    <tr>
                                                        <td style="width: 210px"><span>RUC:</span></td>
                                                        <td style="width: 210px">                                                                                                          
                                                                @Html.TextBoxFor(model => model.prRuc, new { @Class="input",maxlength = "11", minlength = "8"})
                                                                @Html.ValidationMessageFor(model=> model.prRuc)                                                          
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>


                                    <!--DIRECCION-->
                                            <div class="row">
                                                <table style="width: 420px">
                                                    <tr>
                                                        <td style="width: 210px"><span>Direccion*:</span></td>
                                                        <td style="width: 210px"> 
                                                            @Html.TextBoxFor(model => model.prDireccion, new { @Class="input"})
                                                            @Html.ValidationMessageFor(model=> model.prDireccion,null)
                                                        </td>
                                                    </tr>
                                                </table>  
                                            </div>
                                                          
                                      <!--E-MAIL-->
                                            <div class="row">
                                                <table style="width: 420px">
                                                    <tr>
                                                        <td style="width: 210px"><span>Email:</span></td>
                                                        <td style="width: 210px"> 
                                                            @Html.TextBoxFor(model => model.prEmail, new { @Class="input"})
                                                            @Html.ValidationMessageFor(model=> model.prEmail)
                                                        </td>
                                                    </tr>
                                                </table>            
                                            </div> 
                                   <!--TELEFONO-->
                                            <div class="row">
                                                <table style="width: 420px">
                                                    <tr>
                                                        <td style="width: 210px"><span>Telefono:</span></td>
                                                        <td style="width: 210px"> 
                                                            @Html.TextBoxFor(model => model.prTelefono, new { @Class="input",maxlength = "9", minlength = "9"})
                                                            @Html.ValidationMessageFor(model=> model.prTelefono)
                                                        </td>
                                                    </tr>
                                                </table> 
                                            </div>
                                                             
                                <span>&nbsp;</span>
                                 <div id="dialog" title="Modificar Cliente">
                                 <p>Esta seguro que desea modificar los datos del cliente?</p>
                                  </div>
                                 <button id="open"  class="button">Modificar</button>
                               
                                <a href="#" class="button" onclick="document.getElementById('form_1').reset()">Limpiar</a>
                                <a href="IndexPersonaJuridica" class="button" onclick="document.getElementById('form_1').cancel()">Cancelar</a>
                                  </div> 
                              
                            </form>
                   


                    </article>
                </div>

            </section>
        </div>
    </div>

    <!-- / content -->

    <script type="text/javascript"> Cufon.now(); </script>

</body>

